TQGETV and TQGET1
Fortran |
TQGETV(STAVAR, INDEXP, INDEXC, NUMBER, VALAR, IWSG, IWSE) TQGET1(STAVAR, INDEXP, INDEXC, VAL, IWSG, IWSE) |
|
---|---|---|
C-interface |
tq_getv(TC_STRING stavar,TC_INT indexp,TC_INT indexc,TC_INT number,TC_FLOAT* valar,TC_INT* iwsg,TC_INT* iwse); tq_get1(TC_STRING stavar,TC_INT indexp,TC_INT indexc,TC_FLOAT* val,TC_INT* iwsg,TC_INT* iwse); |
|
Full name: |
Get Values. With TQGETV an array of values can be returned; with TQGET1 a single value only. |
|
Purpose: |
These subroutines return the value of any variable in the system after an equilibrium calculation, for example, thermodynamic properties for phases and constituents, temperature, pressure and volume of the system, and amount of the system, a phase or a constituent. |
|
Comments: |
If an equilibrium is not established, the error code is set on return. Go to State Variables Available for TQGETV and TQGET1 for obtaining values. Valid INDEXC or INDEXP has a positive value. Setting INDEXC or INDEXP to -1 means it is not relevant. Using 0 for INDEXC or INDEXP in TQGETV means all components or all phases, respectively. |
|
Arguments |
||
Name |
Type |
Value set on call or returned |
STAVAR |
Character*32 |
Set to mnemonic of state variable |
INDEXP |
Integer |
Set to a phase index |
INDEXC |
Integer |
Set to a component or constituent index |
NUMBER |
Integer |
Set to the number of values in VALAR. |
VALAR |
Double precision array |
Return the values |
VAL |
Double precision |
Return the value |
IWSG |
Integer array |
Workspace |
IWSE |
Integer array |
Workspace |

Get temperature of the system
CALL TQGET1('T',-1,-1,VAL,IWSG,IWSE)
Get overall mole fraction of system component Cr
CALL TQGSCI(INDEXC,'CR',IWSG,IWSE)
CALL TQGET1('X',-1,INDEXC,VAL,IWSG,IWSE)
Get overall mole fractions of all components
CALL TQGETV('x',-1,0,NCOM,VALAR,IWSG,IWSE)
Get activity of system component SiC
CALL TQGSCI(INDEXC,'sic',IWSG,IWSE)
CALL TQGET1('AC',-1,INDEXC,VAL,IWSG,IWSE)
Get activity of gas phase constituent SiC (gas is phase 1)
CALL TQGPCI(1,INDEXC,'sic',IWSG,IWSE)
CALL TQGET1('AC',1,INDEXC,VAL,IWSG,IWSE)
Get total mass of system
CALL TQGET1('M',-1,-1,VAL,IWSG,IWSE)
CALL TQGET1('M',0,0,VAL,IWSG,IWSE)
Get total mass of liquid phase
CALL TQGPI(INDEXP,'LIQUID',IWSG,IWSE)
or
CALL TQGET1('BP',INDEXP,-1,VAL,IWSG,IWSE)
Get mass of all constituents of liquid phase
CALL TQGPI(INDEXP,'LIQUID',IWSG,IWSE)
CALL TQGETV('IM',INDEXP,0,NVAL,VALAR,IWSG,IWSE)
Get mass of SIC in liquid phase
CALL TQGPI(INDEXP,'LIQUID',IWSG,IWSE)
CALL TQGPCI(INDEXP,INDEXC,'sic',IWSG,IWSE)
CALL TQGET1('IM',INDEXP,INDEXC,VAL,IWSG,IWSE)
Get volume of GAS phase
CALL TQGET1('V',1,-1,VAL,IWSG,IWSE)
Get constituent mole fraction of H2O in GAS
CALL TQGPCI(1,INDEXC,'h2o',IWSG,IWSE)
CALL TQGET1('y',1,INDEXC,VAL,IWSG,IWSE)
Get partial pressure of H2O in GAS (equal to the total pressure times the constituent mole fraction)
CALL TQGPCI(1,INDEXC,'h2o',IWSG,IWSE)
CALL TQGET1('y',1,INDEXC,VAL,IWSG,IWSE)
CALL TQGET1('p',-1,-1,PVAL,IWSG,IWSE)
PH2O = PVAL*VAL
Get chemical potentials of all constituents in slag
CALL TQGPI(INDEXP,'slag',IWSG,IWSE)
CALL TQGETV('MUC',INDEXP,0,NCON,VALAR,IWSG,IWSE)
Get the derivative X(LIQUID,CR).X(FE). Where the indices describe the property before the "dot".
CALL TQGPI(INDEXP,'LIQUID',IWSG,IWSE)
CALL TQGSCI(INDEXC,'CR',IWSG,IWSE)
CALL TQGET1('X.X(FE)',INDEXP,INDEXC,VAL,IWSG,IWSE)

Note the following conventions to distinguish between the programming languages.
- Routines starting with TQXXX, for example, TQGDAT, are in the Fortran interface
- Routines starting with tq_xxxx, for example tq_gdat, are in the C-interface.
- In Fortran, all routines are subroutines and do not return any values except where explicitly declared as functions.
- All the C procedures are declared as void and do not return any values except where explicitly otherwise declared.
An example of how to read the subroutine definitions.